package ztttt1;

import java.util.*;
//等腰三角形(⭐⭐⭐)
public class Main1 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int[] A = new int[N];
        int[] B = new int[N];
        for (int i = 0; i < N; i++) {
            A[i] = scan.nextInt();
        }for(int i = 0;i < N;i++){
            B[i] = scan.nextInt();
        }
        Arrays.sort(A);
        Arrays.sort(B);
        int num = 0;
        for(int i = 0,j = 0;i < N; i++){
            if(A[i] * 2 > B[j]){
                num++;
                j++;
            }
        }
        System.out.println(num);
    }
}
//全部都有的子序列(⭐⭐⭐)
class Main3 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int i = 0;
        int j = 0;
        int n = scan.nextInt();
        int[] arr = new int[n];
        int[] Arr = new int[1005];
        int len = 0;
        for (i = 0; i < n; i++) {
            arr[i] = scan.nextInt();
            if(Arr[arr[i]] == 0) {
                Arr[arr[i]] = arr[i];
                len++;
            }
        }
        int min = n;
        for(i = 0;i < n;i++) {
            int num = 0;
            int num0 = 0;
            int[] Arr0 = Arrays.copyOf(Arr,1005);
            j = i;
            while (j < n && num0 != len) {
                if(Arr0[arr[j]] != 0) {
                    Arr0[arr[j]] = 0;
                    num0++;
                }
                num++;
                j++;
            }
            if(num < min && num0 == len){
                min = num;
            }
        }
        System.out.println(min);
        scan.close();
    }
}
//ArrayList的使用
class Main2 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        ArrayList<Integer> arr = new ArrayList<>();
        //1.ArrayList的添加元素
        arr.add(10);
        arr.add(20);
        arr.add(15);
        arr.add(5);
        //2.ArrayList的排序
        //Comparator.naturalOrder() 为指定元素以自然顺序(升序)排序
        arr.sort(Comparator.naturalOrder());
        //Comparator.reverseOrder() 对元素进行(降序)排列的方法
        arr.sort(Comparator.reverseOrder());
        //3.ArrayList下标修改元素
        arr.set(0,1);
        int num = arr.get(0); //1
        //4.获取长度
        int len = arr.size();
        //5.删除元素
        arr.remove(1);
        //6.查询
        if(arr.contains(10)){
            System.out.println("10的下标是:" + arr.indexOf(10));
        }else {
            System.out.println("找不到10");
        }
        //7.subList获取到顺序表中的子表
        List<Integer> a0 = arr.subList(0,2);
        //subList(0,2)为左闭右开[ )
        System.out.println("arr的子表[0,2)为: " + a0);
        System.out.println("arr = " + arr);
        System.out.println("arr 的长度为: " + arr.size());
        //8.clear清空顺序表
        arr.clear();
    }
}

